import request from '../utils/request'
// 文章页，获取详情
const getArticleDetailAPI = ({ artId }) => {
  return request({
    method: 'GET',
    url: `/v1_0/articles/${artId}`

  })
}
// 关注
const followAuthAPI = ({ autId }) => {
  return request({
    method: 'POST',
    url: '/v1_0/user/followings/',
    data: {
      target: autId
    }
  })
}
// 取关
const unfollowAuthAPI = ({ autId }) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/user/followings/${autId}`

  })
}

// 点赞
const liekArtAPI = ({ artId }) => {
  return request({
    method: 'POST',
    url: '/v1_0/article/likings',
    data: {
      target: artId
    }
  })
}
// 取消赞
const dsliekArtAPI = ({ artId }) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/article/likings/${artId}`
  })
}
export {
  getArticleDetailAPI,
  followAuthAPI,
  unfollowAuthAPI,
  liekArtAPI,
  dsliekArtAPI
}
